using FluentNHibernate.Mapping;
using L2NH.Core.Domain;

namespace L2NH.Infrastructure.DataAccess
{
   public class EmployeeMap : ClassMap<Employee>
   {
      public EmployeeMap()
      {
         Table("Employees");

         Id(x => x.Id, "EmployeeID");
         Component(x => x.Name, m =>
            {
               m.Map(x => x.FirstName).Access.ReadOnlyPropertyThroughCamelCaseField(Prefix.Underscore);
               m.Map(x => x.LastName).Access.ReadOnlyPropertyThroughCamelCaseField(Prefix.Underscore);
            });
      }
   }
}